home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
bipl.zip
/
PROGS.ZIP
/
ISTRIP.ICN
< prev
next >
Wrap
Text File
|
1992-09-28
|
1KB
|
40 lines
############################################################################
#
# File: istrip.icn
#
# Subject: Program to strip comments from Icon program
#
# Author: Ralph E. Griswold
#
# Date: March 29, 1992
#
###########################################################################
#
# This program strips comments out of an Icon program. It also removes
# empty lines and leading whitespace (see stripcom.icn).
#
############################################################################
#
# Links: stripcom
#
############################################################################
link stripcom
procedure main()
local line, nextline
while line := read() do {
while line[-1] == "_" do { # handle continued literal
nextline := read() | stop("*** unclosed continued literal")
nextline ?:= {
tab(many(' \t')) # remove leading whitespace
tab(0)
}
line := line[1:-1] || nextline
}
write(stripcom(line))
}
end